package com.suyl.annotationdemo;

import com.suyl.annotationdemo.core.config.PropertiesConfig;
import lombok.extern.log4j.Log4j2;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author : suyl
 * @version : v1.0.0
 * @date : 2020/3/20 15:02
 * @descr : 启动类
 */
@Log4j2
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@EnableConfigurationProperties
public class AnnotationDemoApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext configurableApplicationContext = SpringApplication.run(AnnotationDemoApplication.class, args);
        log.info("【】" + configurableApplicationContext.getBean(PropertiesConfig.class));
        configurableApplicationContext.close(); // 启动完后自动停止
        log.info("started 【annotationApplication】 success.....");
    }
}
